package org.example.springaop.proxy;

/**
 * 静态代理
 */
public class HouseProxy implements HouseSubject{
    private HouseSubject houseSubject;
    public HouseProxy(HouseSubject houseSubject) {
        this.houseSubject = houseSubject;
    }

    @Override
    public void rentHose() {
        // 代理开始
        System.out.println("我是中介，开始代理");
        // 代理房东出租房子
        houseSubject.rentHose();
        // 代理结束
        System.out.println("我是中介，结束代理");
    }

    @Override
    public void saleHouse() {
        // 代理开始
        System.out.println("我是中介，开始代理");
        // 代理房东出售房子
        houseSubject.saleHouse();
        // 代理结束
        System.out.println("我是中介，结束代理");
    }
}
